package zxzx.controller.AcctBsSgmtController;

import java.util.List;
import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import zxzx.controller.AcctBsSgmtService.AcctSpecTrstDspnSgmtService;
import zxzx.controller.pojo.AcctSpecTrstDspnSgmt;
import zxzx.controller.pojo.Result;

@RestController
@RequestMapping("acctSpecTrstDspnSgmt")
public class AcctSpecTrstDspnSgmtController {

	@Autowired
	private AcctSpecTrstDspnSgmtService acctSpecTrstDspnSgmtService;
	
	@RequestMapping("save")
	public Result  save(@RequestBody AcctSpecTrstDspnSgmt acctSpecTrstDspnSgmt) {
		acctSpecTrstDspnSgmtService.save(acctSpecTrstDspnSgmt);
		return new Result(true, "保存成功");
	}
	@RequestMapping("/findAll")
	public List<AcctSpecTrstDspnSgmt> findAll(){
		return acctSpecTrstDspnSgmtService.findAll();
	}
	@RequestMapping("/findOne/{id}")
	public Optional<AcctSpecTrstDspnSgmt> findOne(@PathVariable Integer id){
		return acctSpecTrstDspnSgmtService.findById(id);
	}
	@RequestMapping("/update")
	public Result update(@RequestBody AcctSpecTrstDspnSgmt acctSpecTrstDspnSgmt){
		acctSpecTrstDspnSgmtService.update(acctSpecTrstDspnSgmt);
		return new Result(true, "修改成功");
	}
	@RequestMapping("/createXml/{id}")
	public Result createXml(@PathVariable Integer id){
		acctSpecTrstDspnSgmtService.createXml(id);
		return new Result(true, "生成成功");
	}
	
	
	
	
	
}
